// 用户相关请求模块
import request from '@/utils/api/request.js'
// import request from '@/utils/api/library.js'
// 使用qs：将数据序列化成url格式
import qs from 'qs'

// 获取小组基本信息
export const groupAll = () => {
  return request({
    method: 'GET',
    url: `/group/getAll`
  })
}
// 每周打卡获取信息
export const getWeakSign = (data) => {
  return request({
    method: 'GET',
    url: `/Clock/selectClock?uid=${data}`,
    data
  })
}
// 获取基本信息
export const userInfo = () => {
  return request({
    method: 'GET',
    url: '/userHome/info'
  })
}
// 创建小组请求
export const Signall = params => {
  return request({
    method: 'POST',
    url: '/Clock/selectClock',
    params
  })
}
// 获取最新三条文档数据
export const ThreeLine = () => {
  return request({
    method: 'GET',
    url: `/userHome/getDoc`,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
// 一键打卡
export const weekClock = data => {
  return request({
    method: 'POST',
    url: '/Clock/updateClock',
    data: qs.stringify(data),
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
// 获取所有计划列表
export const GetAllPlan = (params) => {
  return request({
    method: 'POST',
    url: `/plan/selectAllPlans`,
    params,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
export const addPlan = params => {
  return request({
    method: 'POST',
    url: '/plan/create',
    params
  })
}
